#import "BaseNavigationBar.h"

@implementation BaseNavigationBar

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        // Initialization code
    }
    return self;
}

- (void)layoutSubviews {
    CGRect barFrame = self.frame;
    barFrame.size.height = 47.0; //新的高度
    self.frame = barFrame;

//    int index = 0;
//    for ( UIView *one in [self subviews] ) {
//        CGRect tFrame = one.frame;
//        if(index == 1) {
//            [one setFrame:CGRectMake(tFrame.origin.x,0,tFrame.size.width,tFrame.size.height)]; //leftBarButtonItem
//        } else if(index == 2) {
//            [one setFrame:CGRectMake(tFrame.origin.x,0,tFrame.size.width,tFrame.size.height)]; //rightBarButtonItem
//        }
//        ++index;
//    }
}

- (void)drawRect:(CGRect)rect{
    UIImage *backgroundImage = [UIImage imageNamed:@"top_bar_bg.png"];

    [backgroundImage drawInRect:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height)];
    self.backgroundColor = [UIColor clearColor];
    self.tintColor = [UIColor clearColor];
    self.alpha = 1.0;
}

@end